<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<link rel="stylesheet" href="style.css" type="text/css" />

		<script type="text/javascript" src="../flotr/lib/prototype-1.6.0.2.js"></script>
		<script type="text/javascript" src="examples.js"></script>
		
		<!--[if IE]>
			<script type="text/javascript" src="../flotr/lib/excanvas.js"></script>
			<script type="text/javascript" src="../flotr/lib/base64.js"></script>
		<![endif]-->
		<script type="text/javascript" src="../flotr/lib/canvas2image.js"></script>
		<script type="text/javascript" src="../flotr/lib/canvastext.js"></script>
		<script type="text/javascript" src="../flotr/flotr-0.2.0-alpha.js"></script>
	</head>
	<body>
		
		<div id="wrapper">
			<h1></h1>
			<div id="container" style="width:600px;height:300px;"></div>
		</div>
		
		<script type="text/javascript">
			/**
			 * Wait till dom's finished loading.
			 */
			document.observe('dom:loaded', function(){
				/**
				 * Fill series d1 and d2.
				 */
				var d1 = [];
				var d2 = [];
				var d3 = [];
				var d4 = [];
				
				<?php

				$array = array(1,2,3,4,5,6,7,8,9,10);
				foreach ( $array as $element )
				{
					print "d4.push([$element,$element]);\n";
				}
				?> 

				
				
			    for(var i = 0; i < 10; i += 0.1){
					d1.push([i,2*i]);
					d2.push([i, i*1.5+1.5*Math.sin(i)]);
			        d3.push([i, 3*Math.cos(i)+10]);
				}
				
				var f = Flotr.draw(
					$('container'), 
					[{data:d1,mouse:{track:true}}, d2, d3, d4],
					{mouse:{
						track: true,
						lineColor: 'purple',
						relative: true,
						position: 'ne',
						sensibility: 15, // => The smaller this value, the more precise you have to be with the pointer
						trackDecimals: 2,
						trackFormatter: function(obj){ return 'x = ' + obj.x +', y = ' + obj.y; }
					}}
				);
			});			
		</script>
		
	</body>
</html>
